<!DOCTYPE html>
<html>
<head>
<?php $this->load->view('head'); ?>
</head>
<body>
<?php $this->load->view('header'); ?>
<div class="container-fluid main">
	<div class="row">
<?php $this->load->view('left'); ?>
		<div class="main-content col-md-10">
<?php $this->load->view('crumbs'); ?>
			<div class="panel panel-default panel-my">
				<div class="panel-heading">添加列表</div>
				<div class="panel-body">
                    <ul class="nav nav-tabs mb20" role="tablist">
                        <li role="presentation" class="active"><a href="#J_nav_jb" role="tab" data-toggle="tab">基本设置</a></li>
                        <li role="presentation"><a href="#J_nav_gn" role="tab" data-toggle="tab">功能设置</a></li>
                        <li role="presentation"><a href="#J_nav_zt" role="tab" data-toggle="tab">主题分类</a></li>
                        <li role="presentation"><a href="#J_nav_jf" role="tab" data-toggle="tab">积分设置</a></li>
                        <li role="presentation"><a href="#J_nav_mb" role="tab" data-toggle="tab">模板设置</a></li>
                    </ul>
					<form class="form-horizontal J-ajax-form" action="<?php echo site_url('admin/category/edit'); ?>" method="post" accept-charset="utf-8" role="form">
                        <input type="hidden" name="id" value="<?php echo $cat['id']; ?>">
                        <legend>栏目设置</legend>
                        <div class="form-group">
                            <label class="col-md-2 control-label">
                                栏目名称
                            </label>
                            <div class="col-md-10">
                                <input type="text" class="form-control" name="title" value="<?php echo $cat['title']; ?>">
                            </div>
                        </div>
                        <div class="tab-content">
                            <div role="tabpanel" class="tab-pane active" id="J_nav_jb">
                                <legend>基本设置</legend>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        上级栏目
                                    </label>
                                    <div class="row">
                                        <div class="col-md-4">
                                            <select class="form-control input-sm" name="pid">
                                                <option value="0">顶级栏目</option>
                                                <?php echo $cat_dropdown; ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        栏目标识
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="name" value="<?php echo $cat['name']; ?>">
                                        <span class="help-block">只允许字母/数字/下划线/破折号</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        栏目链接
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="link" value="<?php echo $cat['link']; ?>" placeholder="http://">
                                        <span class="help-block">外链以 http:// 开头</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        显示顺序
                                    </label>
                                    <div class="col-md-10">
                                        <input type="number" class="form-control" name="vieworder" value="<?php echo $cat['vieworder']; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        栏目状态
                                    </label>
                                    <div class="col-md-10 checkbox">
                                        <label style="margin-left: -20px;">
                                            <input type="radio" name="status" value="0"<?php echo Utility::if_check($cat['status'] == 0); ?>> <span>关闭</span>
                                        </label>
                                        <label>
                                            <input type="radio" name="status" value="1"<?php echo Utility::if_check($cat['status'] == 1); ?>> <span>开启</span>
                                        </label>
                                        <label>
                                            <input type="radio" name="status" value="2"<?php echo Utility::if_check($cat['status'] == 2); ?>> <span>隐藏</span>
                                        </label>
                                    </div>
                                </div>
                                <legend>SEO设置</legend>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        SEO标题
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="settings[seo_title]" value="<?php echo $cat['settings']['seo_title']; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        SEO关键词
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="settings[seo_keyword]" value="<?php echo $cat['settings']['seo_keyword']; ?>">
                                        <span class="help-block">每个关键词使用英文的逗号<kbd>,</kbd>分隔开</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        SEO描述
                                    </label>
                                    <div class="col-md-10">
                                        <textarea class="form-control" name="settings[seo_descrip]" rows="1"><?php echo $cat['settings']['seo_descrip']; ?></textarea>
                                    </div>
                                </div>
                            </div>
                            <div role="tabpanel" class="tab-pane" id="J_nav_gn">
                                <legend>显示设置</legend>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        列表标题显示字数
                                    </label>
                                    <div class="col-md-10">
                                        <input type="number" class="form-control" name="settings[view_title_length]" value="<?php echo $cat['settings']['view_title_length']; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        列表显示主题个数
                                    </label>
                                    <div class="col-md-10">
                                        <input type="number" class="form-control" name="settings[view_post_perpage]" value="<?php echo $cat['settings']['view_post_perpage']; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        文章评论显示条数
                                    </label>
                                    <div class="col-md-10">
                                        <input type="number" class="form-control" name="settings[view_comment_perpage]" value="<?php echo $cat['settings']['view_comment_perpage']; ?>">
                                    </div>
                                </div>
                                <legend>内容设置</legend>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        允许发布类型
                                    </label>
                                    <div class="table-responsive">
                                        <table class="table table-condensed table-hover">
                                            <thead>
                                                <tr>
                                                    <th class="text-center" width="50">启用</th>
                                                    <th width="70">排序</th>
                                                    <th>类型</th>
                                                </tr>
                                            </thead>
                                            <tbody>
<?php foreach($doc_type as $key => $val) { ?>
                                                <tr>
                                                    <td class="text-center"><input class="J_check" type="checkbox" name="settings[post_allowtype][]" value="<?php echo $key; ?>"<?php echo Utility::if_check(in_array($key, $cat['settings']['post_allowtype'])); ?>></td>
                                                    <td><div class="length0"><input class="form-control input-sm" type="text" name="settings[post_typeorder][<?php echo $key; ?>]" value="<?php echo $cat['settings']['post_typeorder'][$key]; ?>"></div></td>
                                                    <td><?php echo $val[0]; ?></td>
                                                </tr>
<?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        相关审核设置
                                    </label>
                                    <div class="col-md-10 checkbox">
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="settings[post_check]" value="0"<?php echo Utility::if_check($cat['settings']['post_check'] == 0); ?>>
                                                <span>不需审核</span>
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="settings[post_check"] value="1"<?php echo Utility::if_check($cat['settings']['post_check'] == 1); ?>>
                                                <span>审核主题</span>
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="settings[post_check]" value="2"<?php echo Utility::if_check($cat['settings']['post_check'] == 2); ?>>
                                                <span>审核评论</span>
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="settings[post_check]" value="3"<?php echo Utility::if_check($cat['settings']['post_check'] == 3); ?>>
                                                <span>审核主题和评论</span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div role="tabpanel" class="tab-pane" id="J_nav_zt">
                            </div>
                            <div role="tabpanel" class="tab-pane" id="J_nav_jf">
                            </div>
                            <div role="tabpanel" class="tab-pane" id="J_nav_mb">
                                <legend>模板设置</legend>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        频道页模板
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="settings[template_index]" value="<?php echo $cat['settings']['template_index']; ?>" placeholder="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        列表页模板
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="settings[template_list]" value="<?php echo $cat['settings']['template_list']; ?>" placeholder="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label">
                                        详情页模板
                                    </label>
                                    <div class="col-md-10">
                                        <input type="text" class="form-control" name="settings[template_detail]" value="<?php echo $cat['settings']['template_detail']; ?>" placeholder="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group btn-wrap">
                            <div class="col-md-offset-2 col-md-10">
                                <button type="submit" class="btn btn-primary J-ajax-submit-btn mr5">确认提交</button>
                            </div>
                        </div>
					</form>
				</div>
                <!--/.panel-body -->
			</div>
			<!--/.panel -->
		</div>
		<!--/.main-content -->
	</div>
	<!--/.row -->
</div>
<!--/.container-fluid -->
<?php $this->load->view('footer'); ?>
</body>
</html>